@@ -0,0 +1,5 @@ |
||
1 |
+module ServiceHelper |
|
2 |
+ def has_oauth_configuration_for(provider) |
|
3 |
+ ENV["#{provider.upcase}_OAUTH_KEY"].present? && ENV["#{provider.upcase}_OAUTH_SECRET"].present? |
|
4 |
+ end |
|
5 |
+end |
@@ -11,9 +11,15 @@ |
||
11 | 11 |
<%= link_to 'wiki', 'https://github.com/cantino/huginn/wiki/Configuring-OAuth-applications', target: :_blank %> |
12 | 12 |
for guidance. |
13 | 13 |
</p> |
14 |
- <p><%= link_to "Authenticate with Twitter", "/auth/twitter" %></p> |
|
15 |
- <p><%= link_to "Authenticate with 37Signals (Basecamp)", "/auth/37signals" %></p> |
|
16 |
- <p><%= link_to "Authenticate with Github", "/auth/github" %></p> |
|
14 |
+ <% if has_oauth_configuration_for('twitter') %> |
|
15 |
+ <p><%= link_to "Authenticate with Twitter", "/auth/twitter" %></p> |
|
16 |
+ <% end %> |
|
17 |
+ <% if has_oauth_configuration_for('thirty_seven_signals') %> |
|
18 |
+ <p><%= link_to "Authenticate with 37Signals (Basecamp)", "/auth/37signals" %></p> |
|
19 |
+ <% end -%> |
|
20 |
+ <% if has_oauth_configuration_for('github') %> |
|
21 |
+ <p><%= link_to "Authenticate with Github", "/auth/github" %></p> |
|
22 |
+ <% end -%> |
|
17 | 23 |
<hr> |
18 | 24 |
|
19 | 25 |
<div class='table-responsive'> |